// 引入封装好的axios
import request from "@/utils/request"
// 引入数据约束

// 枚举API
enum Api {
  // 1.获取 sku 列表数据
  getSkuInfoApi = "/admin/product/list",
  // 2.上架
  getSkuOnsaleApi = "/admin/product/onSale",
  // 3.下架
  getSkuCancleSaleApi = "/admin/product/cancelSale",
  // 4.删除 某项sku 数据
  deleteSkuInfoApi ="/admin/product/deleteSku"
}

// 书写接口函数
// 1.获取 sku 列表数据
export const reqGetSkuInfo = (page: number, limit: number) => request.get(`${Api.getSkuInfoApi}/${page}/${limit}`)
// 2. 上架
export const reqGetSkuOnSale=(skuId:number)=>request.get(`${Api.getSkuOnsaleApi}/${skuId}`)
// 3.下架
export const reqGetSkuCancleSale = (skuId: number) => request.get(`${Api.getSkuCancleSaleApi}/${skuId}`)
// 4.删除 sku 列表数据
export const reqDelSkuInfo=(skuId:number)=>request.delete(`${Api.deleteSkuInfoApi}/${skuId}`)
